package com.chenke.subject.application.controller;

import com.chenke.subject.application.dto.SubjectInfoDTO;
import com.chenke.subject.common.entity.Result;
import com.chenke.subject.infra.entity.UserInfo;
import com.chenke.subject.infra.rpc.UserRpc;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.annotation.Resources;

@RestController
@RequestMapping("/subject/rpc")
@Slf4j
public class TestController {

    @Resource
    private UserRpc userRpc;


    @PostMapping("/add")
    public String add(){
        UserInfo userInfo = userRpc.getUserInfo("ov63v6ZkgDYKWIIXWVs_D8Q3ZJEQ");
        return userInfo.getUserName();
    }
}
